
export function validateCust(reruiredList, form, diyList) {
  var result = []
  var validatevalue = true

  if (reruiredList.includes('fullname')) {
    if(form.fullname == '') {
      result.push('公司名称')
      validatevalue = false
    }
  }

  if (reruiredList.includes('countryId')) {
    if(form.countryId == '') {
      result.push('国家')
      validatevalue = false
    }
  }

  if (reruiredList.includes('website')) {
    if(form.website == '') {
      result.push('公司网址')
      validatevalue = false
    }
  }

  if (reruiredList.includes('addrs')) {
    if(form.addrs == '') {
      result.push('公司详情地址')
      validatevalue = false
    }
  }

  if (reruiredList.includes('quickAccount')) {
    if(form.quickAccount == '') {
      result.push('快递到付账号')
      validatevalue = false
    }
  }

  if (reruiredList.includes('turnOver')) {
    if(form.turnOver == '') {
      result.push('营业额')
      validatevalue = false
    }
  }

  if (reruiredList.includes('persons')) {
    if(form.persons == '') {
      result.push('雇员数')
      validatevalue = false
    }
  }

  if (reruiredList.includes('fax')) {
    if(form.fax == '') {
      result.push('公司传真')
      validatevalue = false
    }
  }

  if (reruiredList.includes('tel')) {
    if(form.tel == '') {
      result.push('公司座机')
      validatevalue = false
    }
  }

  if (reruiredList.includes('typeId')) {
    if(form.typeId == '' || form.typeId == undefined) {
      result.push('客户分组')
      validatevalue = false
    }
  }

  if (reruiredList.includes('bussType')) {
    if(form.bussType == '') {
      result.push('客户类型')
      validatevalue = false
    }
  }

  if (reruiredList.includes('resourceId')) {
    if(form.resourceId == '') {
      result.push('客户来源')
      validatevalue = false
    }
  }

  if (reruiredList.includes('makeIds')) {
    if(form.makeIds == '') {
      result.push('客户标签')
      validatevalue = false
    }
  }

  if (reruiredList.includes('gradeType')) {
    if(form.gradeType == '') {
      result.push('客户评级')
      validatevalue = false
    }
  }

  if (reruiredList.includes('remarks')) {
    if(form.remarks == '') {
      result.push('客户备注')
      validatevalue = false
    }
  }

  if (reruiredList.includes('socialType')) {
    form.custSocialDtos.forEach((value => {
      if(value.socialType == '' || value.socialWebSite == '') {
        result.push('社交网络')
        validatevalue = false
      }
    }))
  }

  if (reruiredList.includes('belongTo')) {
    if(form.socialType == '') {
      result.push('所属行业')
      validatevalue = false
    }
  }

  if (reruiredList.includes('industryId')) {
    if(form.industryId == '' || form.industryId == undefined) {
      result.push('主营业务')
      validatevalue = false
    }
  }

  if (reruiredList.includes('mainProducts')) {
    console.log('----')
    if(form.mainProducts == '') {
      result.push('意向产品')
      validatevalue = false
    }
  }

  if (reruiredList.includes('linker')) {
    form.custLinkDtos.forEach((value => {
      if(value.linker == '') {
        result.push('联系人名字')
        validatevalue = false
      }
    }))
  }

  if (reruiredList.includes('email')) {
    form.custLinkDtos.forEach((value => {
      if(value.email == '') {
        result.push('联系人邮箱')
        validatevalue = false
      }
    }))
  }

  if (reruiredList.includes('telFax')) {
    form.custLinkDtos.forEach((value => {
      if(value.telFax == '') {
        result.push('联系人电话')
        validatevalue = false
      }
    }))
  }

  if (reruiredList.includes('socialAccount')) {
    form.custLinkDtos.forEach((value => {
      if(value.socialAccount == '' || value.socialType == '') {
        result.push('社交账号')
        validatevalue = false
      }
    }))
  }

  if (reruiredList.includes('postType')) {
    form.custLinkDtos.forEach((value => {
      if(value.postType == '') {
        result.push('职位')
        validatevalue = false
      }
    }))
  }

  if (reruiredList.includes('remarksl')) {
    form.custLinkDtos.forEach((value => {
      if(value.remarks == '') {
        result.push('联系人备注')
        validatevalue = false
      }
    }))
  }

  diyList.forEach(value => {
    console.log(value, 'xxx')
    if(reruiredList.includes(value.key)) {
      if(form[value.key] == '') {
        result.push(value.label)
        validatevalue = false
      }
    }
  })

  var object = {
      type: validatevalue,
      errorMessage: result
  }

  return object
}
